// 当 import.meta.env.SSR === true
// const data = await db(import.meta.env.DB_PASSWORD);

// 当 import.meta.env.SSR === false
// const data = fetch(`${import.meta.env.PUBLIC_POKEAPI}/pokemon/squirtle`);

import { fetchdata } from "@lib/config/siteconfig";

const page = 10
// import { site } from "@libs/config/siteconfig";

const GetallList = fetchdata.api_url + "?limit=" + page
const GetoneId = fetchdata.api_url + "/"

async function getall () {
    const response = await fetch(GetallList)
    const data = await response.json();
    return data.products
}
async function getone(id) {
    const response = await fetch(GetoneId + id);
    const data = await response.json();
    return data
}

export  {getall,getone}
